/**
 * 判断当前按钮是否有权限
 * @param {*} prems 
 * @returns 权限标识,多个逗号分隔
 */
export const handleIsPrem = (prems = '*:*:*') => {
  let result = false

  const allPermission = '*:*:*'
  const permissions = JSON.parse(window.localStorage.getItem('permissions'))

  if (prems && prems.length > 0) {
    const hasPermissions = permissions.some(prem => {
      return allPermission === prem || prems.split(',').includes(prem)
    })

    result = hasPermissions
  } else {
    result = false
  }

  return result
}